A depth of field as deep as possible is required for an endoscope system so that a user can easily perform diagnosis and treatment. In recent years, the depth of field of an endoscope system has become shallow along with the use of an image sensor having a large number of pixels. In view of this, an endoscope system that performs an autofocus (AF) process has been proposed.
In an apparatus, such as an endoscope system, involving monitoring a movie, AF is preferably performed based on wobbling. However, the AF based on the wobbling might continue to fail to bring a subject into focus due to a failure to determine an in-focus direction in a largely blurred state, as a result of an erroneous operation of the AF or the like. In the largely blurred state, a wobbling operation can only provide an extremely small change in an AF evaluation value. In view of this, in a video camera and the like, a subject is determined to be in a largely blurred state (a low contrast state in a broad sense) when a change in the AF evaluation value is extremely small. Then, a control is performed to search for an in-focus position by performing scanning using a focus lens.
For example, JP-A-2011-22404 discloses a method of acquiring a plurality of images with different aperture stops, and determining that a subject is in a largely blurred state when the change in the AF evaluation value is small.
JP-A-2006-245792 discloses an AF control method proposed for a case where a captured image includes a subject (obstacle) other than a target subject. Specifically, in a case where there is an obstacle between the target subject and an imaging device, the target subject is brought into focus with the obstacle designated by a user.